__author__ = 'y.starynets'

def diff21(n):
    if n <= 21:
        return abs(21-n)
    else:
        return abs(21-n)*2

print diff21(21)